Optimal. Leaf size=241 \[ -\frac {3}{4} b^2 n^2 x^2+b n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {b^2 n^2 \left (1+d f x^2\right ) \log \left (1+d f x^2\right )}{4 d f}-\frac {b n \left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )}{2 d f}+\frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )}{2 d f}-\frac {b^2 n^2 \text {Li}_2\left (-d f x^2\right )}{4 d f}+\frac {b n \left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (-d f x^2\right )}{2 d f}-\frac {b^2 n^2 \text {Li}_3\left (-d f x^2\right )}{4 d f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.35, antiderivative size = 241, normalized size of antiderivative = 1.00, number of steps
used = 15, number of rules used = 16, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.615, Rules used = {2504,
2436, 2332, 2424, 2341, 14, 2393, 2338, 6874, 2421, 6724, 2423, 2525, 2458, 45, 2352}
\begin {gather*} \frac {b n \text {PolyLog}\left (2,-d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )}{2 d f}-\frac {b^2 n^2 \text {PolyLog}\left (2,-d f x^2\right )}{4 d f}-\frac {b^2 n^2 \text {PolyLog}\left (3,-d f x^2\right )}{4 d f}-\frac {b n \left (d f x^2+1\right ) \log \left (d f x^2+1\right ) \left (a+b \log \left (c x^n\right )\right )}{2 d f}+\frac {\left (d f x^2+1\right ) \log \left (d f x^2+1\right ) \left (a+b \log \left (c x^n\right )\right )^2}{2 d f}+b n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {b^2 n^2 \left (d f x^2+1\right ) \log \left (d f x^2+1\right )}{4 d f}-\frac {3}{4} b^2 n^2 x^2 \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 45
Rule 2332
Rule 2338
Rule 2341
Rule 2352
Rule 2393
Rule 2421
Rule 2423
Rule 2424
Rule 2436
Rule 2458
Rule 2504
Rule 2525
Rule 6724
Rule 6874
Rubi steps
\begin {align*} \int x \left (a+b \log \left (c x^n\right )\right )^2 \log \left (d \left (\frac {1}{d}+f x^2\right )\right ) \, dx &=-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )}{2 d f}-(2 b n) \int \left (-\frac {1}{2} x \left (a+b \log \left (c x^n\right )\right )+\frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )}{2 d f x}\right ) \, dx\\ &=-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )}{2 d f}+(b n) \int x \left (a+b \log \left (c x^n\right )\right ) \, dx-\frac {(b n) \int \frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )}{x} \, dx}{d f}\\ &=-\frac {1}{4} b^2 n^2 x^2+\frac {1}{2} b n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )}{2 d f}-\frac {(b n) \int \left (\frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )}{x}+d f x \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )\right ) \, dx}{d f}\\ &=-\frac {1}{4} b^2 n^2 x^2+\frac {1}{2} b n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )}{2 d f}-(b n) \int x \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right ) \, dx-\frac {(b n) \int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )}{x} \, dx}{d f}\\ &=-\frac {1}{4} b^2 n^2 x^2+b n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2-\frac {b n \left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )}{2 d f}+\frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )}{2 d f}+\frac {b n \left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (-d f x^2\right )}{2 d f}+\left (b^2 n^2\right ) \int \left (-\frac {x}{2}+\frac {\left (1+d f x^2\right ) \log \left (1+d f x^2\right )}{2 d f x}\right ) \, dx-\frac {\left (b^2 n^2\right ) \int \frac {\text {Li}_2\left (-d f x^2\right )}{x} \, dx}{2 d f}\\ &=-\frac {1}{2} b^2 n^2 x^2+b n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2-\frac {b n \left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )}{2 d f}+\frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )}{2 d f}+\frac {b n \left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (-d f x^2\right )}{2 d f}-\frac {b^2 n^2 \text {Li}_3\left (-d f x^2\right )}{4 d f}+\frac {\left (b^2 n^2\right ) \int \frac {\left (1+d f x^2\right ) \log \left (1+d f x^2\right )}{x} \, dx}{2 d f}\\ &=-\frac {1}{2} b^2 n^2 x^2+b n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2-\frac {b n \left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )}{2 d f}+\frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )}{2 d f}+\frac {b n \left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (-d f x^2\right )}{2 d f}-\frac {b^2 n^2 \text {Li}_3\left (-d f x^2\right )}{4 d f}+\frac {\left (b^2 n^2\right ) \text {Subst}\left (\int \frac {(1+d f x) \log (1+d f x)}{x} \, dx,x,x^2\right )}{4 d f}\\ &=-\frac {1}{2} b^2 n^2 x^2+b n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2-\frac {b n \left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )}{2 d f}+\frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )}{2 d f}+\frac {b n \left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (-d f x^2\right )}{2 d f}-\frac {b^2 n^2 \text {Li}_3\left (-d f x^2\right )}{4 d f}+\frac {\left (b^2 n^2\right ) \text {Subst}\left (\int \frac {x \log (x)}{-\frac {1}{d f}+\frac {x}{d f}} \, dx,x,1+d f x^2\right )}{4 d^2 f^2}\\ &=-\frac {1}{2} b^2 n^2 x^2+b n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2-\frac {b n \left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )}{2 d f}+\frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )}{2 d f}+\frac {b n \left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (-d f x^2\right )}{2 d f}-\frac {b^2 n^2 \text {Li}_3\left (-d f x^2\right )}{4 d f}+\frac {\left (b^2 n^2\right ) \text {Subst}\left (\int \left (d f \log (x)+\frac {d f \log (x)}{-1+x}\right ) \, dx,x,1+d f x^2\right )}{4 d^2 f^2}\\ &=-\frac {1}{2} b^2 n^2 x^2+b n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2-\frac {b n \left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )}{2 d f}+\frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )}{2 d f}+\frac {b n \left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (-d f x^2\right )}{2 d f}-\frac {b^2 n^2 \text {Li}_3\left (-d f x^2\right )}{4 d f}+\frac {\left (b^2 n^2\right ) \text {Subst}\left (\int \log (x) \, dx,x,1+d f x^2\right )}{4 d f}+\frac {\left (b^2 n^2\right ) \text {Subst}\left (\int \frac {\log (x)}{-1+x} \, dx,x,1+d f x^2\right )}{4 d f}\\ &=-\frac {3}{4} b^2 n^2 x^2+b n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {b^2 n^2 \left (1+d f x^2\right ) \log \left (1+d f x^2\right )}{4 d f}-\frac {b n \left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )}{2 d f}+\frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )}{2 d f}-\frac {b^2 n^2 \text {Li}_2\left (-d f x^2\right )}{4 d f}+\frac {b n \left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (-d f x^2\right )}{2 d f}-\frac {b^2 n^2 \text {Li}_3\left (-d f x^2\right )}{4 d f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.16, size = 519, normalized size = 2.15 \begin {gather*} \frac {-d f x^2 \left (2 a^2-2 a b n+b^2 n^2+2 b^2 n \left (n \log (x)-\log \left (c x^n\right )\right )+4 a b \left (-n \log (x)+\log \left (c x^n\right )\right )+2 b^2 \left (-n \log (x)+\log \left (c x^n\right )\right )^2\right )+d f x^2 \left (2 a^2-2 a b n+b^2 n^2-2 b (-2 a+b n) \log \left (c x^n\right )+2 b^2 \log ^2\left (c x^n\right )\right ) \log \left (1+d f x^2\right )+\left (2 a^2-2 a b n+b^2 n^2+2 b^2 n \left (n \log (x)-\log \left (c x^n\right )\right )+4 a b \left (-n \log (x)+\log \left (c x^n\right )\right )+2 b^2 \left (-n \log (x)+\log \left (c x^n\right )\right )^2\right ) \log \left (1+d f x^2\right )+2 b n \left (2 a-b n-2 b n \log (x)+2 b \log \left (c x^n\right )\right ) \left (\frac {1}{2} d f x^2-d f x^2 \log (x)+\log (x) \log \left (1-i \sqrt {d} \sqrt {f} x\right )+\log (x) \log \left (1+i \sqrt {d} \sqrt {f} x\right )+\text {Li}_2\left (-i \sqrt {d} \sqrt {f} x\right )+\text {Li}_2\left (i \sqrt {d} \sqrt {f} x\right )\right )-b^2 n^2 \left (d f x^2-2 d f x^2 \log (x)+2 d f x^2 \log ^2(x)-2 \log ^2(x) \log \left (1-i \sqrt {d} \sqrt {f} x\right )-2 \log ^2(x) \log \left (1+i \sqrt {d} \sqrt {f} x\right )-4 \log (x) \text {Li}_2\left (-i \sqrt {d} \sqrt {f} x\right )-4 \log (x) \text {Li}_2\left (i \sqrt {d} \sqrt {f} x\right )+4 \text {Li}_3\left (-i \sqrt {d} \sqrt {f} x\right )+4 \text {Li}_3\left (i \sqrt {d} \sqrt {f} x\right )\right )}{4 d f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.01, size = 0, normalized size = 0.00 \[\int x \left (a +b \ln \left (c \,x^{n}\right )\right )^{2} \ln \left (d \left (\frac {1}{d}+f \,x^{2}\right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int x\,\ln \left (d\,\left (f\,x^2+\frac {1}{d}\right )\right )\,{\left (a+b\,\ln \left (c\,x^n\right )\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________